import request from '@/utils/request'

// 获取投诉列表
export function getComplaintList(params) {
  return request({
    url: '/api/complaint/list',
    method: 'get',
    params
  })
}

// 获取投诉详情
export function getComplaintDetail(id) {
  return request({
    url: `/api/complaint/detail/${id}`,
    method: 'get'
  })
}

// 提交投诉
export function submitComplaint(data) {
  return request({
    url: '/api/complaint/submit',
    method: 'post',
    data
  })
}

// 下载附件
export function downloadAttachment(id) {
  return request({
    url: `/api/complaint/attachment/${id}`,
    method: 'get',
    responseType: 'blob'
  })
}